<!DOCTYPE html>
<html>
<head>
    <title>Login Page</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f2f2f2;
        }
        .container {
            max-width: 400px;
            margin: 0 auto;
            padding: 20px;
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        .container h2 {
            text-align: center;
            margin-bottom: 20px;
        }
        .form-group {
            margin-bottom: 15px;
        }
        .form-group label {
            display: block;
            font-weight: bold;
        }
        .form-group input {
            width: 100%;
            padding: 8px;
            border-radius: 3px;
            border: 1px solid #ccc;
        }
        .form-group .captcha {
            display: flex;
            align-items: center;
        }
        .form-group .captcha input {
            flex: 1;
        }
        .form-group .captcha img {
            margin-left: 10px;
            cursor: pointer;
        }
        .form-group .captcha img:hover {
            opacity: 0.8;
        }
        .form-group .submit-btn {
            text-align: center;
            margin-top: 20px;
        }
        .form-group .submit-btn input {
            padding: 10px 20px;
            background-color: #4CAF50;
            color: #fff;
            border: none;
            border-radius: 3px;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div class="container">
    <h2>Login</h2>
    <form action="/login/dologin" method="post">
        <div class="form-group">
            <label for="username">Username:</label>
            <input type="text" id="username" name="username" required>
        </div>
        <div class="form-group">
            <label for="password">Password:</label>
            <input type="password" id="password" name="password" required>
        </div>
        <div class="form-group">
            <label for="captcha">Captcha:</label>
            <div class="captcha">
                <input type="text" id="captcha" name="captcha" required>
                <img src="/login/kapchar" alt="Captcha Image" onclick="refreshCaptcha()">
            </div>
        </div>
        <div class="form-group submit-btn">
            <input type="submit" value="Login">
        </div>
    </form>
</div>
<script>
    function refreshCaptcha() {
        var captchaImg = document.querySelector('.captcha img');
        captchaImg.src = "/login/kapchar?timestamp=" + new Date().getTime();
    }
</script>
</body>
</html>
